package com.yugao.fintech.antelope.auth.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yugao.fintech.antelope.auth.model.entity.LocalUser;
import com.yugao.fintech.antelope.auth.model.rqrs.*;

import java.util.List;

/**
 * 本地授权
 */
public interface LocalUserService extends IService<LocalUser> {
    /**
     * 通过账号获取本地授权信息
     */
    LocalUser getUser(LocalUserGetReq req);

    LocalUser getUserByUserId(Long userId);

    /**
     * 更新授权信息, 如果密码不为空, 必须是明文密码, 因为内部已经实现了加密逻辑
     */
    boolean updateLocalUser(LocalUser req);

    void deleteLocalUser(Long userId);

    void resetPassword(UserResetPwdReq req);

    boolean resetPassword(AdminResetPwdReq req);

    void saveLocalUser(LocalUser req);

    void batchDeleteLocalUser(Long tenantId, List<Long> userIds);

    void batchUpdateLocalUser(List<LocalUser> req);

    List<LocalUser> listAuth(LocalUserListReq query);

    /**
     * 注销账号
     */
    void cancelAccount(CancelAccountReq req);
}